let href = location.href;
function getUrlParams(url) {
       let reg = /^[^\s]+\?([^&\s\d]+=[^\s]+)*/
       let match = reg.exec(url)
       match = match[1]
       if (!match) {
           console.warn("没有匹配到相应的query参数")
           return null
       }
       let queryString = decodeURI(match);
       let queryArr = queryString.split("&");
       let queryParamsObj = {}
       queryArr.forEach(item => {
           let itemArr = item.split("=")
           queryParamsObj[itemArr[0]] = itemArr[1]
       })
       return queryParamsObj
   }
let qr = getUrlParams(href)
let { couponid } = qr;

$.ajax({
    type : "get",
    url : `http://chst.vip:1234/api/getcouponproduct?couponid=${couponid}`
}).then((res)=>{
var arr = res.result;
let html = ''
arr.forEach(item =>{
    html += `
    <li data-index=${item.couponProductId}>
    <div class="img">${item.couponProductImg}</div>
    <div class="infoR">
        <div class="title">
            <h4>${item.couponProductName}</h4>
        </div>
        <div class="other">
            <h4 class="price">${item.couponProductPrice}</h4>
            <div class="mall">${item.couponProductTime}</div>
        </div>
    </div>
    </li>
    `
  })
  $('.info').html(html)
 })